@tool
extends CanvasLayer

class_name RankLayer

@onready var rank_lines = $PanelContainer/Panel/RankLines

# Called when the node enters the scene tree for the first time.
func _ready():
	pass
	
func setScore(arr_score: Array):
	arr_score.sort_custom(func (x, y): return x > y)
	
	for child in rank_lines.get_children():
		child.queue_free()
	
	for i in range(min(5, arr_score.size())):
		RankLine.new_rank_line(i+1, arr_score[i], rank_lines)
